package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.MvDAO;
import cn.nebula.music.domain.Mv;

@Component
public class StringToMvConverter implements Converter<String, Mv> {

	@Autowired
	private MvDAO mvDAO;

	@Override
	public Mv convert(String source) {
		System.out.println(source);
		return mvDAO.findMvById(Integer.valueOf(source));
	}

}
